翻訳と辞書
Words near each other
・ Prillieuxina
・ Prillimäe
・ Prillwitz
・ Prillwitz idols
・ Prilly
・ Prilly Latuconsina
・ Prilocaine
・ Prilozje
・ Priluka
・ Prilukskoye oil field
・ Priluzsky District
・ Prim
・ Prim (Neckar)
・ Prim Pujals
・ Prim Siripipat
Prim's algorithm
・ Prim, Arkansas
・ Prim, Virginia
・ PRIM1
・ PRIM2
・ PRIMA
・ Prima
・ PRIMA (Indonesia)
・ Prima (locomotive)
・ Prima (magazine)
・ Prima (news agency)
・ PRiMA Aero Trasporti Italiani
・ Prima Air
・ Prima apple
・ Prima ballerina assoluta


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Prim's algorithm : ウィキペディア英語版
Prim's algorithm

In computer science, Prim's algorithm is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized. The algorithm operates by building this tree one vertex at a time, from an arbitrary starting vertex, at each step adding the cheapest possible connection from the tree to another vertex.
The algorithm was developed in 1930 by Czech mathematician Vojtěch Jarník〔.〕 and later rediscovered and republished by computer scientists Robert C. Prim in 1957〔.〕 and Edsger W. Dijkstra in 1959.〔.〕 Therefore, it is also sometimes called the DJP algorithm,〔.〕 Jarník's algorithm,〔.〕 the Prim–Jarník algorithm,〔.〕 or the Prim–Dijkstra algorithm.〔.〕
Other well-known algorithms for this problem include Kruskal's algorithm and Borůvka's algorithm.〔.〕 These algorithms find the minimum spanning forest in a possibly disconnected graph; in contrast, the most basic form of Prim's algorithm only finds minimum spanning trees in connected graphs. However, running Prim's algorithm separately for each connected component of the graph, it can also be used to find the minimum spanning forest.〔.〕 In terms of their asymptotic time complexity, these three algorithms are equally fast for sparse graphs, but slower than other more sophisticated algorithms.〔〔
However, for graphs that are sufficiently dense, Prim's algorithm can be made to run in linear time, meeting or improving the time bounds for other algorithms.〔, p. 77.〕
== Description ==
The algorithm may informally be described as performing the following steps:
In more detail, it may be implemented following the pseudocode below.

| Return ''F''
}}
As described above, the starting vertex for the algorithm will be chosen arbitrarily, because the first iteration of the main loop of the algorithm will have a set of vertices in ''Q'' that all have equal weights, and the algorithm will automatically start a new tree in ''F'' when it completes a spanning tree of each connected component of the input graph. The algorithm may be modified to start with any particular vertex ''s'' by setting ''C''() to be a number smaller than the other values of ''C'' (for instance, zero), and it may be modified to only find a single spanning tree rather than an entire spanning forest (matching more closely the informal description) by stopping whenever it encounters another vertex flagged as having no associated edge.
Different variations of the algorithm differ from each other in how the set ''Q'' is implemented: as a simple linked list or array of vertices, or as a more complicated priority queue data structure. This choice leads to differences in the time complexity of the algorithm. In general, a priority queue will be quicker at finding the vertex ''v'' with minimum cost, but will entail more expensive updates when the value of ''C''() changes.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Prim's algorithm」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.